package cn.lili.controller.promotion;

import cn.lili.common.utils.ResultUtil;
import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.promotion.entity.vos.TicketAreaStatisticsVO;
import cn.lili.modules.promotion.entity.vos.TicketStatisticsVO;
import cn.lili.modules.promotion.service.TicketStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "工作台接口")
@RequestMapping("/promotion/ticket/statistics")
@RequiredArgsConstructor
public class TicketStatisticsController {
    private final TicketStatisticsService ticketStatisticsService;

    @ApiOperation(value = "门票统计数据")
    @GetMapping
    public ResultMessage<TicketStatisticsVO> getTicketStatistics() {
        return ResultUtil.data(ticketStatisticsService.getTicketStatistics());
    }

    @ApiOperation(value = "统计今天各区域已售票数")
    @GetMapping("getTodayByArea")
    public ResultMessage<List<TicketAreaStatisticsVO>> getTodayByArea() {
        return ResultUtil.data(ticketStatisticsService.getTodayStatistics());
    }

}
